#!/usr/bin/python3
# -*- coding = utf-8 -*-
# @Author：xxx
# @Description：
import os
from typing import Text


def root_path():
    path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    return path


def ensure_path_sep(path: Text) -> Text:
    """兼容 windows 和 linux 不同环境的操作系统路径 """
    if "/" in path:
        path = os.sep.join(path.split("/"))

    if "\\" in path:
        path = os.sep.join(path.split("\\"))
    return root_path() + path


if __name__ == '__main__':
    print(root_path())
    print(ensure_path_sep('\\test'))

